<?php
/*
Plugin Name: Elliot XML-RPC Server
Plugin URI: http://www.jumping-duck.com/wordpress/
Description: XML-RPC callback server for plug-in developers.  Uses WordPress' built-in XML-RPC class to parse remotely queued error reports from plug-ins.
Version: 0.1
Author: Eric Mann
Author URI: http://www.eamann.com
License: GPL2
*/

/**
  * Copyright 2010  Eric Mann  (email : eric@eamann.com)
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License, version 2, as 
  * published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
if(!defined( 'ELLIOT_DIR' ))
	define( 'ELLIOT_DIR', dirname(__FILE__));
	
require_once(ELLIOT_DIR . '/includes/admin.php'); 
require_once(ELLIOT_DIR . '/includes/functions.php');

function elliot_install() {
	/**
	 * Now we check to see if version 1.0 has already been installed.  If yes, we do nothing.
	 * If no, then we install the system.
	 */
	$elliot_version = get_option('Elliot_Version');
	if ( ! $elliot_version ) {
		add_option('Elliot_Version', '0.1');
		$elliot_new_install=true;
	}
	
	if( $elliot_new_install==true )
		include(ELLIOT_DIR . '/includes/install.php');	//This runs the database installation scripts.  We only need it once
}
register_activation_hook(__FILE__,'elliot_install'); 


add_action('admin_menu', 'elliot_add_admin');
function elliot_add_admin() {
    add_management_page('Reported Errors', 'Errors', 1, 'elliot/includes/admin.php', 'admin_page');
}
?>